Skip to content

Feature/hw10 threads - #10

Merged
alex-popkov merged 11 commits into
mainfrom
feature/hw10-threads
Jul 20, 2026
Merged

alex-popkov merged 11 commits into
mainfrom
feature/hw10-threads

Conversation

@alex-popkov

Copy link
Copy Markdown
Owner
  • Introduce multithreading: DronePhysics, MissionProcessor, and TargetProvider run on separate threads, communicating via a thread-safe command queue and telemetry snapshots
  • Implement ThreadSafeTargetProvider wrapping ITargetProvider with mutex-guarded access, and DronePhysics with its own thread running a physics loop
  • Refactor architecture to separate concerns: MissionProcessor owns the state machine (decision-making), DronePhysics owns the drone state (position, speed, direction) and executes physics based on DroneCommand{state, angleSpeed}
  • Simplify DroneContext to be internal to DronePhysics only — MissionProcessor reads drone state exclusively through DroneTelemetry (single snapshot per step to avoid race conditions)
  • Introduce DroneStateInput struct as the interface for IDroneState::execute(), replacing individual parameters and eliminating unused-parameter warnings
  • Replace string-based state names with enum class DroneStates across all 5 state classes
    Compute acceleration once in MissionProcessor::init() instead of recalculating each step

…rone_physics. change createProvider factory. Fix main.cpp and mission_processor to use new targetProvider and drone physics. It works in one thread
…r drone physics, missionProcessor and target provider. Implemented threads in main.cpp, move all loop logic in mission processor
…m of a class. Fix MissionProcessor: call this->dronePhysics->sendCommand at the end of the mission step
…ocessor. keep only changing of drone context in phisycs. mp decide what should be a current state and send command to physics.
@alex-popkov
alex-popkov requested a review from farnblack June 23, 2026 20:26
…lver interface. Solve return BallisticResult
…nto feature/hw10-threads

# Conflicts:
#	drone_simulation/include/config_loaders/factory.hpp
#	drone_simulation/src/config_loaders/factory.cpp
#	drone_simulation/src/main.cpp
#	drone_simulation/src/simulation.cpp
@alex-popkov
alex-popkov merged commit bb4dc42 into main Jul 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant